﻿<UserControl x:Class="UniversalEditor.Archive.ArchiveView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:archive="clr-namespace:UniversalEditor.Archive"
             mc:Ignorable="d" d:DataContext="{x:Static archive:ArchiveViewModel.Designer}"
             d:DesignHeight="300" d:DesignWidth="300">
	<Grid>
		<ListView ItemsSource="{Binding FilesNames}" MouseDoubleClick="OnMouseDoubleClick">
			<ListView.ItemContainerStyle>
				<Style TargetType="ListViewItem">
					<Setter Property="IsSelected" Value="{Binding IsSelected}"/>
				</Style>
			</ListView.ItemContainerStyle>
			<ListView.View>
				<GridView>
					<GridViewColumn Header="Name" Width="300">
						<GridViewColumn.CellTemplate>
							<DataTemplate>
								<StackPanel Orientation="Horizontal">
									<Image Source="{Binding Icon}"/>
									<TextBlock Text="{Binding DisplayName}" Margin="5,0,0,0"/>
								</StackPanel>
							</DataTemplate>
						</GridViewColumn.CellTemplate>
					</GridViewColumn>
					<GridViewColumn Header="Size" DisplayMemberBinding="{Binding Size}"/>
					<GridViewColumn Header="Modified" DisplayMemberBinding="{Binding LastWriteTime}"/>
					<GridViewColumn Header="CRC32" DisplayMemberBinding="{Binding Crc}"/>
				</GridView>
			</ListView.View>
			<ListView.ContextMenu>
				<ContextMenu>
					<MenuItem Header="Extract Selected Items..." Command="{Binding ExtractCommand}"/>
					<MenuItem Header="Extract All" Command="{Binding ExtractAllCommand}"/>
				</ContextMenu>
			</ListView.ContextMenu>
		</ListView>
	</Grid>
</UserControl>
